import request from '@/utils/request'

// 获取分区树状列表
export function getAreaTree(rootId = '') {
  return request({
    url: '/dispatch/web/jiankong/areas/tree',
    method: 'get',
    params: { rootId }
  })
}

// 根据分区ID获取站点列表
export function getStationsByArea(areaId) {
  return request({
    url: '/dispatch/web/jiankong/stations/list',
    method: 'get',
    params: { areaId }
  })
}

// 根据站点获取摄像头列表
export function getCamerasByStation(stationId) {
  return request({
    url: '/dispatch/web/jiankong/cameras/list',
    method: 'get',
    params: { stationId }
  })
}

// 获取摄像头详情
export function getCameraDetail(cameraId) {
  return request({
    url: '/dispatch/web/jiankong/cameras/detail',
    method: 'get',
    params: { cameraId }
  })
}

// 根据摄像头ID获取码流列表
export function getStreamsByCamera(cameraId) {
  return request({
    url: '/dispatch/web/jiankong/streams/list',
    method: 'get',
    params: { cameraId }
  })
}

// 获取历史视频记录列表
export function getHistoryVideos(params) {
  return request({
    url: '/dispatch/web/jiankong/history/list',
    method: 'get',
    params
  })
}